package com.itheima.test;

public class Demo3 {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder();
        //添加
        sb.append("hello").append("world").append("java");
        System.out.println(sb);
        //反转
        StringBuilder s = sb.reverse();
        System.out.println(s);
        //toString
        String s1 = s.toString();
        System.out.println("s1 = " + s1);//字符串
        System.out.println(new StringBuilder(s1));//不是字符串
    }
}
